package com.company;

public class Main {

    public static double help(double x,int n){
        if(n==1)return x;
        double result=help(x,n/2);
        if(n%2 == 0){
            return result*result;
        }else{
            return result*result*x;
        }
    }

    public static double myPow(double x,int n){
        if(n==1)return x;
        if(n==0)return 1;
        if(x==1)return x;
        if(x>1 && n==-2147483648)return 0;
         double result=0;
        result=help(x,Math.abs(n));
        if(n<0)result=1/result;
        return result;
    }
    //0.00001
    //2147483647
    public static void main(String[] args) {
	System.out.println(myPow(2.00,-2147483648));
        //System.out.println(Math.abs(-2147483647));
    }
}
